; AAConst.txt
;
; M.J.Austin Nov 1988
;
; Copyright (C) 1988 Level 9 Computing
;

table
 list0=0 ; variable table ptr
 MenuTable=4
 List11=11 ; ptr to list ptrs
 ACBList=14
 StructureBuffer=15
 ContextTable=16
 List17=17 ; 64 bytes of scratchpad for Driver block
 List18=18 ; scratchpad area (64K on ST)
 List19=19
 list20=20
 TempMovedSprite=20
 PermMovedSprite=21
 TempFixedSprite=22
 PermFixedSprite=23
 TextBuffer=24 ; filled whenever WordWs(TextBufferOffset)<>0
 list25=25

 Map=27 ; map giving block numbers for display etc. Word Based.
 SpriteTable=28
 LongWS=29
 WordWS=30
 ByteWS=31

;-------------------

const
 Editor=0 ; conditional assembly - disable clipping etc.
 NotEditor=1

 IBMClipPosition=159 ;(IBMTopOfText-1)
 IBMTopOfText=160
 IBMTextHeight=40
 IBMTextLimit=33 ;(IBMTextHeight-7)

; draw flags are...
 dRemoveRedraw=65535 ;  -1 Remove and redraw
 dInsert=0 ;   0 insert
 dPlot=1 ;   1 plot as sprite
 dInsertRedraw=2 ;   2 insert and redraw
 dMarkPreload=3 ;   3 mark to preload
 dSetProtect=4 ;   4 set protection mark
 dUnsetProtect=5 ;   5 unsert protection mark

; offsets for Hires() list - i.e. list 12.
 SizeHiresList=16000 ; 12000 ; total space allocated to it, in bytes. 64 per object
; first few bytes are Hires(Object*16)=x,z,h pos.
; for all TA objects.
 StartDoorPositions=12000 ;;3200 ; 200*16. Gives x,z,h,graphics object num.
; of doors leading from currently displayed room.
; each entry in hires list is made up of 8 words:
; hires(x+0)=x
; hires(x+2)=z
; hires(x+4)=h
; hires(x+6)=x pos from which object may be accessed by a person
; hires(x+8)=z pos from which object may be accessed.
; hires(x+10)=h pos from which object may be accessed.

; offsets in List4...
 EnterFromOffset=64 ;;32
 DoorOpenOffset=128 ;;64
 ThroughDoorOffset=256 ;;128

; animation constants...
;; GMJ 25/8/89 Now a Var ;; ACBStart=0 ; start within ACBList
 ACBSearchStartMinus1=767
 ACBSearchStart=768 ; NuMNPC*ACBSize
 ACBEnd=1150 ; end within ACBList
 ACBSortStart=1200 ; =ACBEnd. Table used for priortization of sprites
 ACBSize=64 ; at least 42=ACBStackStart+AcbEntries*4. size of ACB entry in bytes
 ACBEntries=5 ; 6 ; ACB is 5 word header, followed by double-word entries.
 ACBStackStart=32 ; offset within ACB of first entry in stack
 ACBStackStartMinus1=31
 ACBStackEnd=64 ;AcbStackStart+ACBEntries*6

 ACBXOffset=4
 ACBZOffset=6
 ACBHOffset=8
 ACBRasterOffset=10 ; amount to add on to raster objects
; used within this acb.

 ACBDestX=12
 ACBDestZ=14
 ACBDestH=16
 ACBFinePosOffset=18
 ACBTimeInRoom=19
 ACBStatus=20
 ACBPreviousStatus=21
 ACBAngleFromIntended=22
 ACBIntendedDirection=23
 ACBHaltDelay=24
 ACBObjectOffset=26 ; the object number this acb corresponds to
 ACBSearchTime=28
 ACBPreviousDistance=30

; values set in acbstatus
; All low values (<128) mean that the npc
; is under the sole control of the graphics task.

; ACBToDoor=1 ; game uses direction 1..8 instead nowadays. Indicates
; that npc is doing a local gd to go through a door.
 ACBGeneralGD=16 ; a non-specific local gd is underway.
 ACBFindNPC=17 ; same as generalgd, but trying to find a person
 ACBPushedAway=18 ; temp GD when being pushed out of someone's way
 ACBAscending=20 ; actor is ascending stairs
 ACBDescending=21 ; actor is descending stairs

; All higher values (>128) indicate that the npc
; may be controlled by either strategy or graphics
; tasks.
 ACBStuck=252 ; an NPC couldn't get to its destination.
 ACBArrived=253 ; ACBStatus set to this when a local gd has finished. Cleared
; by strategy task when appropriate action has been taken.
 ACBInterruptibleGD=254 ; person is moving, but
; can be stopped or a new sequence started without
; any problems.
 ACBIdle=0 ; ACBStatus set to this when no local gd is in place.
; - i.e. person is not moving (or is under user control)

; no sprite is ever ENTIRELY controlled by the strategy
; task (whilst it is on-screen)
;----

 MaxTicks=5
;-------
; co-ordinate ranges for use by mouse handler code.
 MinXUpperDisplayArea=16
 MaxXUpperDisplayArea=200
 MinYUpperDisplayArea=0
 MaxYUpperDisplayArea=200

 MinXLowerDisplayArea=16
 MaxXLowerDisplayArea=200
 MinYLowerDisplayArea=100
 MaxYLowerDisplayArea=200

 MinXColourBar=304
 MinYColourBar=32
 MaxYColourBar=160
 SizeColourBarElement=8

;-
 RasterType=1
 XZHType=2
 AnimationType=3
 CompressedType=4
 CellType=5
 NeoType=6

 NeoObjectNumber=0
 MagnifyObjectNumber=65535
 MagnifyXSize=8
 MagnifyYSize=8
 HalfMagnifyXSize=4
 HalfMagnifyYSize=4


 NumCells=1000

 UpperContextType=1
 LowerContextType=2

Blocks=0 ; default editing mode - i.e. EditMode
Pixels=1 ; an editing mode
;-
; ObjectBufferSize=800 ; in bytes = (ObjectXSize+ObjectYSize)*2
; ObjectXSize=20 ; horizontal size in 16x16 blocks
; ObjectXSizeMinus1=19
; ObjectYSize=20
; ObjectYSizeMinus1=19
; sizes for nearly full screen...
 ScreenXSize=15
 ScreenYSize=5
 ScreenXSizePixels=241 ; pixels: =ScreenXSize*16+1
 ScreenYSizePixels=161 ; pixels: =ScreenYSize*16+1

; reduced screen size for testing:
; ScreenXSize=10
; ScreenYSize=7
; ScreenXSizePixels=161 ; pixels: =ScreenXSize*16+1
; ScreenYSizePixels=113 ; pixels: =ScreenYSize*16+1
;---
; false=0
; true=1
;----
 NeoScreenOffset=0 ; within list18
 EditorNeoOffset=32768 ; within list18
; (remember that List operations won't find this data
; due to them being treated as signed offsets)
;----
 ScreenXBlocks=50
 ScreenXBlocksTimes2=100
 ScreenYBlocks=50
 MapSize=5000 ; ScreenXBlocks*ScreenYBlocks*2 (word based map table)

 UpMapStep=65546 ; -ScreenXBlocks*2
 RightMapStep=2 ; word-based map
 DownMapStep=100 ; ScreenXBlocks*2
 LeftMapStep=65534 ; word-based map

 SpriteTableSize=3600 ; MaxMovingSprites*48
;
; output buffer offsets (i.e. list 2 offsets)
 StartOutputBuffer=0
;; EndOutputBuffer=255
 EndOutputBufferPlus1=256 ; offset of first byte after used area of buffer
 SizeOutputBuffer=256 ; EndOutputBufferPlus1-StartOutputBuffer
 StartScreenLineBuffer=256
 EndScreenLineBuffer=296
;--------
; message manifest constants...
; space=197
; cr=198
; dot=199
;---
; offsets within LongWs
 HiLongRandomSeed=8 ; long value
 LoLongRandomSeed=10 ; long value
HiLongLogicalBase=12
LoLongLogicalBase=14
; holds address 8 less than the real physical base
; to allow the leftmost 16 pels to be clipped in an elegant fashion

LongPhysicalBase=16
HiLongPhysicalBase=16
LoLongPhysicalBase=18
; holds address of currently displayed screen
; holds address of currently displayed screen

LongOSScreenAddress=20
; screen address when game started

HiLongTextScreenBase=24
LoLongTextScreenBase=26
; base address for writing text to.

 HiLongCurrentTaskMTCB=28
 LoLongCurrentTaskMTCB=30
 HiLongNextTaskMTCB=32
 LoLongNextTaskMTCB=34

 HiLongSpriteDataPtr=108
 LoLongSpriteDataPtr=110

 HiLongFreeWorkSpace=124
 LoLongFreeWorkSpace=126

 LongGraphicsScreenBase=160 ; where MC thinks the screen on
; which to write graphics is. cf. TextScreenBase
 HiLongGraphicsScreenBase=160
 LoLongGraphicsScreenBase=162
;------
; offsets within WordWs
 WordCursorXPos=0
 WordCursorYPos=2
 WordFrameTime=4
 WordPlayer1SpriteOffset=6

 WordScreenXPos=8
 WordScreenYPos=10
 WordScreenXMax=12
 WordScreenYMax=14
 WordPlayerXMax=16
 WordPlayerYMax=18

 WordScreenXBlocks=20
 WordScreenYBlocks=22
 WordXPosSave=24
 WordYPosSave=26
 WordTextBufferOffset=28
 WordFreeSprites=30
 WordMouseXDistance=32
 WordMouseYDistance=34
 WordSuspendTaskSwap=36
 WordUseVM=38
 WordVBLDisabled=40

 WordRasterOffset=56
 WordErrorNumber=66
;--------
; offsets within ByteWs
 ByteJoystickStatus=0
 ByteLastKeyPressed=1
; ByteFrameReadyFlag=2
 ByteInvertFlag=3
 ByteBreakPointArmed=4
 ByteScrollStep=5
 ByteCurrentWeapon=6

 ByteFrameReadyFlag=9
 ByteStarPhase=10
 ByteWordWrapWidth=11

; offsets within permament sprite data block
 StationaryAnimationOffset=14
 MovingAnimationOffset=16
 FightAnimationOffset=18
 ThrowAnimationOffset=20
 InitialHitPointOffset=22
 InitialBlowStrengthOffset=24
 TimeBetweenBlowsOffset=26
 NumAnimationOffset=27
 TypeOffset=28
 SpeedOffset=29
 NullMovesOffset=30
 DistanceOffset=35
 AddDirOffset=37

;CDWithPlayer equ 0 * bit 0
;CDWithMissiles equ 1
;CDWithMonsters equ 2
;CDWithBG equ 3 * bit 3
;CDWithObject equ 4
;CDWithInvisibles equ 5
;CDWithMonsterMissile equ 6

; PlayerMask=1
; MissileMask=2
; MonsterMask=4
; BGMask=8
; ObjectMask=16
; InvisibleMask=32
; MonsterMissileMask=64

; PlayerType=1
; MissileType=2
; MonsterType=4
; BGType=8
; ObjectType=16
; InvisibleType=32
; MonsterMissileType=64

;; offsets within temporary sprite data block
; xspeedOffset=4
; YSpeedOffset=6
; XPosOffset=8
; YPosOffset=10
; DataPtrOffset=12 ; LONG
; LoDataPtrOffset=14
; NameOffset=24
; HitPointOffset=26
; BlowStrengthOffset=28
; TimeToNextBlowOffset=30
; ViewOffset=31
; StageOffset=32 ; animation stage
; LifeCounterOffset=36
; AnimationOffset=38

; offsets of linked list pointers within LL list.
; note that many of these are referenced by MenuTable
 LLPlayerInv=0 ; ll showing player's inventory
 LLRangedWeapons=2 ; ll giving available ranged weapons
 LLEntrySize=10
 LLTableSize=250

; offsets of entries in LL table.
 InvNameOffset=2 ; contains a word giving the "name" of the
 RWNameOffset=2 ; holds word value
 RWTypeOffset=4 ; holds byte value
; object held. This will usually by the same as the number
; of the sprite data.

MenuDelay=1000 ; slow down menu to prevent flickering display

; offsets within RoomData
; ExitOffsetBase=4
; North=2
; East=4
; South=6
; West=8

;
; offsets within Workspace List
 RoomTableOffset=0 ; gives number of exits used from each
 RoomTableEntrySize=8 ; room - used in maze drawing

; offsets within list7
 NextAddDirTableOffset=10
 ConvertViewToXY=38 ; 18+20 because index into table is -5..+5
 ConvertViewToView=67 ; 62+5 """     ""    ""    ""  ""    ""

;-------
;; sprite data numbers...
;; i.e. NAMES of OBJECTS (objects)
; user=256
; Bottle=14
; Sword=15
; Shield=16
; Ring=17
; Wand=18
; Scroll=19
; Gold=20
; Club=21
 StructureBufferList=15

;---------
